package com.example.lenovo.demo.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.lenovo.demo.R;
import com.example.lenovo.demo.model.databean.StrategyBean;
import com.example.lenovo.demo.presenter.StrategyChildFgPresenter;
import com.example.lenovo.demo.view.ifgview.IStrateChildFragment;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

import java.util.List;

/**
 * Created by Lenovo on 2017/1/15.
 */
@ContentView(R.layout.fragment_stratechild)
public class StrateChildFragment extends Fragment {
    private View view;
    private StrategyBean.PagesBean pagesBean;
    private IStrateChildFragment Fgview;
    private StrategyChildFgPresenter presenter;
    @ViewInject(R.id.strategy_childfg_rv)
    private RecyclerView recyclerView;


    public static StrateChildFragment getFragment(StrategyBean.PagesBean pagesBean){
        Bundle bundle=new Bundle();
        bundle.putParcelable("msg",pagesBean);
        StrateChildFragment fragment=new StrateChildFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view= x.view().inject(this,inflater,container);
        initView();
        initData();
        return view;
    }

    private void initData() {
        pagesBean=getArguments().getParcelable("msg");
        presenter=new StrategyChildFgPresenter();
        Fgview=presenter;
        Fgview.sendView(recyclerView,getActivity(),pagesBean);
        presenter.initData();
    }

    private void initView() {

    }
}
